import request from '@/utils/request'

export function fetchDepartmentList() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

export function fetchManagerList() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

export function fetchAddDepart(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

export function fetchDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

export function fetchUpdateDepart(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

export function fetchDelDepart(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
